package shuati.tengxun;

import java.util.Scanner;

/**
 * @author : LdLtd
 * @Date : 2023/11/16
 * @Description:云智客户端2
 * 接受一个整数数组，将每个元素转换为二进制表示，然后根据二进制中1和0的数量输出不同的结果。
 */
public class yunzhike2 {
    //3 11 2 10
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int [] ar=new int[n];
        for (int i = 0; i < n; i++) {
            ar[i]=sc.nextInt();
        }
        int count0=0;
        int count1=0;
        for (int num : ar) {
            String str=Integer.toBinaryString(num);
            for (char c : str.toCharArray()) {
                if(c=='1'){
                    count1++;
                }else {
                    count0++;
                }
            }
            if(count0%2==0&&count1%2==0){
                System.out.print("10"+" ");
            }else if(count0%2==0){
                System.out.print("0"+" ");
            }else if(count1%2==0){
                System.out.print("1"+" ");
            }else {
                System.out.print("100"+" ");
            }
            count0=0;
            count1=0;
        }

    }
}
